﻿using Orleans;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Zj.OrleansDemo.Interface;

namespace Zj.OrleansDemo.Service
{
    /// <summary>
    /// user service implement
    /// </summary>
    public class UserService : Grain, IUserService
    {
        public async Task<bool> AddOrUpdateAsync(int? id)
        {

            Thread.Sleep(3000);
            if (id == null)
            {
                Console.WriteLine("添加成功");
                return await Task.Run(
                    () =>
                {
                    return true;
                });
            }
            Console.WriteLine("修改成功");
            return await Task.Run(
                    () =>
                    {
                        return true;
                    });
        }
    }
}
